﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using IBKBerget.Models;

namespace IBKBerget.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            ViewBag.Message = "IBK Berget";

            using (Entities db = new Entities())
            {
                var articles = db.Articles.OrderByDescending(a => a.CreatedDate).Take(6).ToList();

                return View(articles);
            }
        }

        public ActionResult About()
        {
            return View();
        }
    }
}
